#ifndef TIME_H
#define TIME_H

#include <utility>
#include <iostream>

class Time {
private:
    int secs, mins;
public:
    // Constructors & destructor
    Time();
    Time(int mins, int secs);
    Time(const Time &other);
    ~Time();

    // Setters & getters
    void setTime(int mins, int secs);
    void setTime(std::pair<int, int> m_s);
    void setSeconds(int secs);
    void setMinutes(int mins);
    std::pair<int, int> getTime();
    int getSeconds();
    int getMinutes();

    // Overloads
    Time & operator=(const Time &other);
    Time & operator=(Time &&other) noexcept;
    Time operator+(const Time &op);
    Time operator-(const Time &op);
    Time & operator+=(const Time &op);
    Time & operator-=(const Time &op);
    bool operator==(const Time &op);
    bool operator!=(const Time &op);
    bool operator<(const Time &op);
    bool operator>(const Time &op);
    bool operator<=(const Time &op);
    bool operator>=(const Time &op);

    // Friend functions
    friend std::ostream & operator<<(std::ostream &os, const Time &time);
    friend std::istream & operator>>(std::istream &is, Time &time);
};

Time seconds(int secs);
Time minutes(int mins);

std::ostream & operator<<(std::ostream &os, const Time &time);
std::istream & operator>>(std::istream &is, Time &time);

#endif // TIME_H
